package com.smart.manager.product.entities.views;

import com.smart.common.entities.core.BaseView;
import com.smart.manager.product.entities.enums.PigstyKind;
import io.ebean.annotation.DbArray;
import io.ebean.annotation.View;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
import java.util.List;


/**
 * 游戏管理 猪圈资料
 * @author leo
 * @date 2023/09/05
 */
@Data
@Entity
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@View(name = "product_basic_pigsty")
public class BasicPigstyView extends BaseView {


    /**
     * 猪圈代码
     */
    @Id
    @NotBlank(message = "猪圈代码 不能为空")
    @Length(max = 30, message = "猪圈代码 不能超过30个字符")
    @ApiModelProperty("猪圈代码")
    private String code;
    /**
     * 猪圈名称
     */
    @ApiModelProperty("猪圈名称")
    private String name;

    @ApiModelProperty("猪圈类型")
    private PigstyKind kind;

    @ApiModelProperty("是否有机")
    private Boolean isOrganic;


    @ApiModelProperty("摄像头代码")
    @DbArray
    private List<String> cameraCode;

    @ApiModelProperty("摄像头地址")
    private transient List<String> cameraUrl;

}